﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:n="http://nRoute/schemas/2010/xaml"
    mc:Ignorable="d"
    x:Class="Officer2013.Shell"
	MinWidth="640" MinHeight="520">
	
	<UserControl.Resources>
        <n:ValueRelay x:Name="ViewServiceTypeRelay" Initialize="ViewServiceTypeRelay_Initialize_1" />
		<Storyboard x:Name="BallonStoryboard">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" 
                                           Storyboard.TargetProperty="(UIElement.Opacity)">
				<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.00">
					<EasingDoubleKeyFrame.EasingFunction>
						<QuadraticEase/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="00:00:00.7500" Value="1">
					<EasingDoubleKeyFrame.EasingFunction>
						<QuarticEase EasingMode="EaseInOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="00:00:03.5000" Value="1">
					<EasingDoubleKeyFrame.EasingFunction>
						<QuarticEase EasingMode="EaseInOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
				<EasingDoubleKeyFrame KeyTime="00:00:04" Value="0">
					<EasingDoubleKeyFrame.EasingFunction>
						<QuarticEase EasingMode="EaseInOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>		
	</UserControl.Resources>
    
    
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
        <n:ViewServiceBehavior ViewServiceType="{Binding Value, Source={StaticResource ViewServiceTypeRelay}}" ViewServiceName="ShellShowMessageViewService" />
	</i:Interaction.Behaviors>
    
	<Grid x:Name="LayoutRoot">
        
        <!-- CONTAINER GRID -->
		<Grid x:Name="ContainerGrid" Background="{StaticResource ShellBackgroundBrush}">
            
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="106"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="38"/>
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="31"/>
				<RowDefinition Height="*"/>
				<RowDefinition Height="21"/>
			</Grid.RowDefinitions>
            
            <!-- BACK BUTTON -->
			<Border BorderBrush="{x:Null}" Margin="0,0,-15,0" BorderThickness="0,0,0,1" Cursor="Hand"
                    Background="{StaticResource BackButtonPrimaryBrush}" 
					OpacityMask="{StaticResource BackButtonOpacityBrush}">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="MouseLeftButtonUp">
                        <!--<n:DirectionalNavigateAction Direction="Back" />-->
						<n:NavigateAction Url="Pages/NonExistentPage/" HandlerName="DefaultContainer"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
				<Border BorderBrush="{x:Null}" Background="{StaticResource BackButtonSecondaryBrush}">
					<Grid>
						<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="12"
							Foreground="#FFFFFFFF" Text="Back" TextWrapping="Wrap"/>
						<Path Fill="#FFFFFFFF" Stretch="Fill" HorizontalAlignment="Left" Margin="24.689,6.573,0,8.573" 
                              Width="14.854" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" 
                              Style="{StaticResource OfficeLogoStyle}"/>
					</Grid>
				</Border>
			</Border>
            
			<Border Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="1" Grid.RowSpan="1" BorderBrush="{x:Null}" 
				BorderThickness="0,0,0,0" CornerRadius="8,8,8,8" HorizontalAlignment="Left" Margin="0,-5,0,0" 
				Background="#FFFFFFFF">
				<Border.Effect>
					<DropShadowEffect BlurRadius="14" Color="#BF000000" Direction="0" ShadowDepth="-50"/>
				</Border.Effect>
                
				<!-- CUSTOM CONTAINER, WITH CUSTOM TEMPLATE -->
				<n:StatefulBrowsingContainer x:Name="DefaultContainer"
					Url="Dialogs/NewDialog" Style="{StaticResource OfficerContainerStyle}">
					<i:Interaction.Behaviors>
						<n:NavigationHandlerBehavior IsDefaultHandler="True"/>
					</i:Interaction.Behaviors>
				</n:StatefulBrowsingContainer>
                
			</Border>
            
			<ListBox x:Name="LinksListBox" Margin="0,11,0,20" BorderThickness="0,0,0,0" 
				SelectionMode="Single" BorderBrush="{x:Null}" Foreground="{x:Null}"
				ItemsSource="{Binding SiteMapNodes}" Style="{StaticResource LinksListBoxStyle}" 
				ItemTemplate="{StaticResource LinkTemplate}" 
				ItemContainerStyle="{StaticResource LinkContainerStyle}" 
				HorizontalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="1" Grid.RowSpan="2" 
				Grid.Column="0" Grid.Row="1" >
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Loaded">
						<n:SetPropertyAction PropertyName="SelectedIndex" Value="1"/>
					</i:EventTrigger>
                    <i:EventTrigger EventName="SelectionChanged">
                        <n:ExecuteSiteMapNodeAction SiteMapNode="{Binding SelectedItem, ElementName=LinksListBox, Mode=OneWay}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
			</ListBox>
            
		</Grid>
        
        <!-- BALLON -->
		<Border x:Name="border" Height="53" Margin="0,0,60,37" VerticalAlignment="Bottom" BorderBrush="#7F6C6C6C" 
                BorderThickness="1,1,1,1" CornerRadius="5,5,5,5" Width="Auto" HorizontalAlignment="Right" Opacity="0">
			<Border.Effect>
				<DropShadowEffect/>
			</Border.Effect>
			<Border.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FF313131" Offset="0.988"/>
					<GradientStop Color="#FF202020" Offset="0"/>
					<GradientStop Color="#FF080808" Offset="0.48"/>
					<GradientStop Color="#FF1A1A1A" Offset="0.524"/>
				</LinearGradientBrush>
			</Border.Background>
			<TextBlock Text="Welcome" TextWrapping="NoWrap" Foreground="#FFFFFFFF" 
				FontFamily="Arial" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" 
                x:Name="BallonText" Margin="20,0,20,0"/>
		</Border>
        
	</Grid>
</UserControl>